#include "stm32f10x.h"                  // Device header
#include "uart.h"
#include "OLED.h"   
#include "KEY.h"
#include "stdlib.h"
#include "LED.h"
#include <string.h>


int main()
{
    usart_init(9600);
    OLED_Init();
    LED_Init();
    
     while(1)
    {
        if(usart_get_rxflag() == SET)
        {
            OLED_ShowString(1,1,"                       ");            
            OLED_ShowString(1,1,Serial_RxPacket);
            if(strcmp(Serial_RxPacket,"LED_ON") == 0)
            {               
                LED1_ON();
                LED2_ON();
                //send_string("LED_ON OK");
                OLED_ShowString(4,1,"LED_ON OK");
            }
            if(strcmp(Serial_RxPacket,"LED_OFF") == 0)
            {
                LED1_OFF();
                LED2_OFF();
            }
            
        }
    }
}
